<?php if (!defined('BASEPATH')) { die('No direct script access allowed'); }


/**
 * Generate Digg Button
 *
 * Adds a Digg This! Button to your site.
 *
 * @access	public
 * @param	string
  * @param	bool
 * @return	string
 */	
if (! function_exists('generateDiggButton'))
{
	function generateDiggButton($link='', $smallSize=false)
	{
		$js = '';
		
		if($link != '' or $smallSize)
		{
			$js .= '<script type="text/javascript">';
			if($link != '')
			{
				$js .= 'digg_url = "'.$link.'";';
			}
			
			if($smallSize)
			{
				$js .= 'digg_skin = "compact";';
			}
			$js .= '</script>';
		}
		
		$js .= '<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>';
		return $js;
	}
}

?>